import { PartialType } from '@nestjs/mapped-types';
import {
  IsInt,
  IsNotEmpty,
  IsOptional,
  IsString,
  IsUUID,
  MinLength,
} from 'class-validator';
import { DictItem } from '../entities/dict-item.entity';

export class SaveDictItemDto extends PartialType(DictItem) {
  @IsNotEmpty()
  @IsUUID()
  typeId: string;

  @IsString()
  @MinLength(1)
  label: string;

  @IsString()
  @MinLength(1)
  value: string;

  @IsInt()
  @IsOptional()
  order?: number;

  @IsOptional()
  @IsString()
  remark?: string;

  @IsUUID()
  @IsOptional()
  id?: string;
}
